package com.cedric.yixianpai.game.cards.Sects.swordCards.b_ZhuJi;

import com.cedric.yixianpai.game.Constants.CardType;
import com.cedric.yixianpai.game.Constants.Period;
import com.cedric.yixianpai.game.Status.DuelStatus;
import com.cedric.yixianpai.game.interfaces.SwordCard;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;

/**
 * 云剑·无锋
 * 连云：9/13/17
 */
@Component
public class Yun_WuFeng extends SwordCard {
    public Yun_WuFeng(@Value("1") int lvl) {
        super("云剑·无锋");
        this.setPeriod(Period.ZHUJI);
        this.setDescription("连云：9/13/17攻");
        this.setCardType(CardType.YUN);
        if (1 == lvl) {
            this.setLevel(1);
            this.setDamage(9);
        } else if (2 == lvl) {
            this.setLevel(2);
            this.setDamage(13);
        } else if (3 == lvl) {
            this.setLevel(3);
            this.setDamage(17);
        }
    }

    @Override
    public boolean effect(DuelStatus Sta1, DuelStatus Sta2) {
        if (Sta1.lastIs(CardType.YUN)) {
            Sta1.attack(Sta2, this.getDamage());
            Sta1.getPlayerBuff().setSwordIntent(0);
            return true;
        }
        return false;
    }
}
